import Vue from "vue"
import Vuex from "vuex"

Vue.use(Vuex)

const state = {
    course: {
        backgroundImage: '',
        courseName: '',
        studyClass: '',
        courseCode: '',
        courseNumber: ''
    },
    homework: "",
    studentNumber: "",
    homeworkId: ""
}
const mutations = {
    //保存数据
    setCourseInformation(state, data) {
        state.course = data
    },
    setCourseCode(state, courseCode) {
        state.course.couresCode = courseCode
    },
    setHomeWork(state, data) {
        state.homework = data
    },
    setFile(state, data) {
        state.studentNumber = data.studentNumber
        state.homeworkId = data.homeworkId
    }
}
const actions = {
    // updateMyCourse({commit}, payload) {
    //     commit('setMyCourse', payload)
    // }
}
export default {
    //解决模块名冲突
    namespaced: true,
    state,
    mutations,
    actions
}
